#include <cstdio>
#include <ctime>
#include <iomanip>
#include <ios>
#include <iostream>
#include <locale>
// manipulator
using namespace std;
int main() {
  bool myBool{true};
  cout << "this is the default: " << myBool << endl;
  cout << "this is should be true: " << boolalpha << myBool << endl;
  cout << "this is should be 1: " << noboolalpha << myBool << endl;

  int i{123};
  printf("this should be '   123': %6d\n", i);
  cout << "this should be '   123': " << setw(6) << i << endl;
  // fill '0'
  printf("this should be '000123': %06d\n", i);
  cout << "this should be '000123': " << setw(6) << setfill('0') << i << endl;
  // fill '*'
  // printf("this should be '***123': %06d\n", i);
  cout << "this should be '***123': " << setfill('*') << setw(6) << i << endl;

  // floating point value
  double d1{1.452};
  double d2{5};
  cout << "this should be '@@1.452': " << setw(7) << setfill('@') << noshowpoint
       << d1 << endl;
  cout << "this should be '@@1.452': " << setw(7) << setfill('@') << showpoint
       << d1 << endl;
  cout << "this should be ' 5': " << setw(2) << setfill(' ') << d2 << endl;

  cout.imbue(locale{""}); // use local formatter to foramt a number
  cout << "This is 1234567 formatted according to your location: " << 1234567
       << endl;

  cout << "this should be a monetary value of 12000, "
       << "formatted according to you location: " << put_money("12000") << endl;

  time_t t_t{::time(nullptr)};
  tm *t{localtime(&t_t)};
  cout << "this should be the current date and time  "
       << "formatted according to you location: " << put_time(t, "%c") << endl;

  cout << "This should be: \"Quoted string with \\\"embedded quotes\\\".\":"
       << quoted("Quoted string with \"embedded quotes\".");
  std::string s;
  cin >> s;
}